using System;

namespace MessagingWPF.Infrastructure.Test
{
	public class FakeSubscriber : ISubscriber<OtherTestMessage>, ISubscriber<SomeTestMessage>
	{
		public static readonly Type[] MessageTypes = new[] {typeof (OtherTestMessage), typeof (SomeTestMessage)};

		public Action<SomeTestMessage> ActionWhenRecievingMessage;
		public SomeTestMessage RecievedMessage;

		#region ISubscriber<OtherTestMessage> Members

		public void Handle(OtherTestMessage message)
		{
			throw new NotImplementedException();
		}

		#endregion

		#region ISubscriber<SomeTestMessage> Members

		public void Handle(SomeTestMessage message)
		{
			RecievedMessage = message;

			if (ActionWhenRecievingMessage != null)
			{
				ActionWhenRecievingMessage(message);
			}
		}

		#endregion
	}
}